package com.h3c.dal.entity.query;

public class BaseQuery {
	/** 分页查询参数 */
	private Integer pageIndex;
	private Integer pageSize = 10;
	private Integer startRow;
	/** 分页查询结果 */
	private Integer count;
	private Integer pageCount;

	public Integer getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
		this.startRow = this.pageSize * (pageIndex - 1);
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getStartRow() {
		return startRow;
	}
	public void setStartRow(Integer startRow) {
		this.startRow = startRow;
	}
	public Integer getCount() {
		return count;
	}
	public void setCount(Integer count) {
		this.count = count;
	}
	public Integer getPageCount() {
		return pageCount;
	}
	public void setPageCount(Integer pageCount) {
		this.pageCount = pageCount;
	}
	public void calculatePageCount() {
		this.pageCount = count % getPageSize() == 0 ? count / getPageSize() : count / getPageSize() + 1;
	}
}
